<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>确认华为订单-check</title>
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Home/css/cartCheck.css"/>
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Home/css/footer.css"/>
		<link rel="shortcut icon" href="{{__PUBLIC__}}/Home/images/favicon.ico">
		<script type="text/javascript" src="{{__PUBLIC__}}/Home/js/jquery-1.8.2.min.js"></script>
		<script type="text/javascript" src="{{__PUBLIC__}}/Home/js/area.js"></script>
		<script type="text/javascript" src="{{__PUBLIC__}}/Admin/hdjs/hdjs.min.js"></script>
	    <link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Admin/hdjs/hdjs.css"/>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			#progress-cart-dy{
                display: none;
            }
            #progress-confirm-dy{
                display: block;
            }
			 #progress-submit-dy{
                display: none;
            }
		</style>
		<script>
			$(function(){
					//出现半透明盖子
				$('.editAddress').click(function(){
					$('#cover').css({display:'block'});
					$('.changeAddress').css({display:'block'});
				});
					//地址框的出现消失
				$('.changeAddress span').live('click',function(){
					$('.changeAddress').css({display:'none'});
					$('#cover').css({display:'none'});
				});
				$('.changeAddress .no').live('click',function(){
					$('.changeAddress').css({display:'none'});
					$('#cover').css({display:'none'});
				});
				//初始化方法
				area.init('a');
				//修改的时候默认被选中效果
				area.selected('请选择','请选择','请选择');
					//添加新地址
				$('.ok').click(function(){
					var address = String($('select[name=sheng]').val()) + String($('select[name=shi]').val()) + String($('select[name=xian]').val()) +String($('textarea[name=xiang]').val());
					var consignee = $('#holder').val();
					var postcode = $('input[name=postcode]').val();
					var mobile = $('#mobile').val();
					$.ajax({
							//请求地址
						url:"{{U('Address/add')}}",
							//发送数据
						data:{address:address,consignee:consignee,postcode:postcode,mobile:mobile},
							//请求类型
						type:'post',
							//返回的数据类型
						dataType:'json',
							//成功返回
						success:function(data){
							if(data){
								$('.changeAddress').css({display:'none'});
								$('#cover').css({display:'none'});
								location.reload();
							}
						}
					})
				})
				$('.address-dy').on('click','.address-default-dy',function(){
					$(this).find('i').addClass('cur').end().siblings('.address-default-dy').find('i').removeClass('cur');
					$(this).find('input[name=default]').attr('checked',true);
				})
			})
		</script>
	</head>
	<body>
		<div id="cover"></div>
		<!--顶部-->
		{{include file="VIEW_PATH/Common/orderHead.php"}}
			<!--收货地址-->
		<div class="order-dy">
			<form id="f1" onsubmit="return hd_submit($('form#f1'),'{{U('OrderList/check')}}','{{U('Orders/index')}}')">
				<div class="address-dy">
					<span class="block-dy"></span><h3 class="as-title-dy">收货人信息&nbsp;&nbsp;<a class="editAddress" href="javascript:;">[使用新地址]</a></h3>
					{{foreach from="$address" value="$v"}}
						<div class="address-default-dy">
							<i></i><span class="send-to">寄送至</span>
							<div class="address-info">
								<p class="user-info"><input type="radio" name="default" id="" checked="checked"/>&nbsp;&nbsp;&nbsp;&nbsp;<input  class="username-dy" type="text" name="neckname" value="{{$_SESSION['username']}}"></p>&nbsp;&nbsp;&nbsp;&nbsp;
								<p><input type="text"  class="address" name="address" placeholder="收货地址" value="{{$v['address']}}"></p>&nbsp;&nbsp;&nbsp;&nbsp;
								<p>收货人：<input type="text" class="consignee" name="consignee" value="{{$v['consignee']}}"></p>&nbsp;&nbsp;&nbsp;&nbsp;
								<p>电话：<input type="text" class="phone" name="mobile" value="{{$v['mobile']}}"></p>
							</div>
							<div class="address-sub">
								<span class="del-dy">X</span>
								<a href="javascript:;">默认地址</a>
								<a href="javascript:;" class="editAddress">修改</a>
							</div>
						</div>
					{{endforeach}}
				</div>
					<!--收货地址-->
				<!-- <div class="hr-30"></div> -->
					<!--物品详情-->
				<div class="layout-dy">
					<div class="order-title-dy">
						<p>以下商品由  <span id="saler-dy">华为商城</span>选择合作快递配送</p>	
					</div>
					<div class="list-dy">
						<div class="good-list-dy">
							<div>
								<table border="0" cellspacing="" cellpadding="" class="table-bt-dy">
										<tr class="title-dy">
											<th width="654" height="30">商品</th>
											<th width="155" height="30">单价（元）</th>
											<th width="190" height="30">数量</th>
											<th width="190" height="30">小计（元）</th>
										</tr>
								</table>
							</div>
							<div class="goods-lists-dy">
								<table border="0" cellspacing="" cellpadding="" class="table-2-dy">
									{{foreach from="$_SESSION['cart']['goods']" key="$k" value="$v"}}
										<tr height="50">
											<td width="654" height="18">
												<div class="good-area-dy">
													<p class="g-name-dy"><a href="">{{$v['name']}}</a></p>
												</div>
											</td>
											<td width="155" height="18"><span>¥{{$v['price']}}</span></td>
											<td width="190" height="18" class="g-num-dy">
												{{$v['num']}}
											</td>
											<td width="190" height="18" class="g-stotal-dy"><span>¥{{$v['total']}}</span></td>
											<input type="hidden" name="glid" value="{{$v['glid']}}">
										</tr>
									{{endforeach}}
								</table>
							</div>
						</div>
						
						<div class="total-dy">
							<div class="total-left-dy">
								
							</div>
							<div class="total-right-dy">
								<table border="0" cellspacing="" cellpadding="" class="total-table-dy">
									<tr>
										<th>商品总金额：</th><td>¥{{$_SESSION['cart']['total']}}</td>
									</tr>
									<tr>
										<th>共节省：</th><td>¥0.00</td>
									</tr>
									
								</table>
								<div class="no-free">
										<span>应付金额：</span><span class="money-dy">¥{{$_SESSION['cart']['total']}}</span></>
								</div>
							</div>
						</div>
						<div class="hr-20"></div>
						<div class="action-area-dy">
							<input type="hidden" name="user_uid" value="{{$_SESSION['uid']}}">
							<input type="hidden" name="total" value="{{$_SESSION['cart']['total']}}" >
							<input type="submit" value="提交订单" class="sub-total-dy"/>
							<p>应付总额：<span class="money-dy">¥{{$_SESSION['cart']['total']}}</span></p>
						</div>
					</form>
						<div class="changeAddress">
							<span></span>
							<table class='form'>
								<tr class='shoujianren'>
									<th><span>*</span>收货人：</th>
									<td>
										<input type="text" name="consig" id="holder" />
									</td>
								</tr>
								<tr class='shouhuodizi'>
									<th><span>*</span>收货地址：</th>
									<td>
										<select name="sheng" id="a1">
											<option value="">-请选择-</option>

										</select>
										<select name="shi" id="a2">
											<option value="">-请选择-</option>

										</select>
										<select name="xian" id="a3">
											<option value="">-请选择-</option>

										</select>
									</td>
								</tr>
								<tr class='textar'>
									<th></th>
									<td>
										<textarea name="xiang" placeholder="详细地址"></textarea>
									</td>
								</tr>
								<tr class='youbian'>
									<th>邮编</th>
									<td>
										<input type="text" maxlength="6" name="postcode" id="" />
									</td>
								</tr>
								<tr class='shoujianren'>
									<th><span>*</span>手机号码</th>
									<td>
										<input type="text" maxlength="11" name="phone" id="mobile" />
									</td>
								</tr>
								<tr class='default'>
									<th></th>
									<td>
										<input type="checkbox" name="" id="" /><span></span>设为默认地址
									</td>
								</tr>
								<tr class='sub'>
									<th></th>
									<td>
										<input type="button" class="ok" value="确认">
										<a class="no" href="javascript:;">取消</a>
									</td>
								</tr>
							</table>
						</div>
				</div>
			</div>
		</div>
		<div class="hr-60"></div>
		<!--底部-->
		{{include file="VIEW_PATH/Common/footer.php"}}

	</body>
</html>
	</body>
</html>